subdir('dbus-interfaces')
subdir('theme')
-theme_resources = gnome.compile_resources(
- 'gnome-shell-theme', 'gnome-shell-theme.gresource.xml',
- source_dir: 'theme',
- dependencies: theme_deps,
- gresource_bundle: true,
- install: true,
- install_dir: pkgdatadir
-)
-
-osk_layout_resources = gnome.compile_resources(
- 'gnome-shell-osk-layouts', 'gnome-shell-osk-layouts.gresource.xml',
- source_dir: 'osk-layouts',
- gresource_bundle: true,
- install: true,
- install_dir: pkgdatadir
-)
+data_resources = [
+ ['dbus-interfaces', []],
+ ['osk-layouts', []],
+ ['theme', theme_deps]
+]
+foreach resource : data_resources
+ gnome.compile_resources(
+ 'gnome-shell-' + resource[0],
+ 'gnome-shell-@0@.gresource.xml'.format(resource[0]),
+ source_dir: resource[0],
+ dependencies: resource[1],
+ gresource_bundle: true,
+ install: true,
+ install_dir: pkgdatadir
+ )
+endforeach
perfconf = configuration_data()
perfconf.set('datadir', datadir)
var LOCALEDIR = '@datadir@/locale';
/* other standard directories */
var LIBEXECDIR = '@libexecdir@';
+var PKGDATADIR = '@datadir@/@PACKAGE_NAME@';
var VPNDIR = '@vpndir@';
/* g-i package versions */
var LIBMUTTER_API_VERSION = '@LIBMUTTER_API_VERSION@'
const Gio = imports.gi.Gio;
const GLib = imports.gi.GLib;
const Lang = imports.lang;
+const Config = imports.misc.config;
const Params = imports.misc.params;
function collectFromDatadirs(subdir, includeUserDir, processFile) {
recursivelyMoveDir(srcChild, destChild);
}
}
+
+let _ifaceResource = null;
+function loadInterfaceXML(iface) {
+ if (!_ifaceResource) {
+ // don't use global.datadir so the method is usable from tools
+ let path = Config.PKGDATADIR + '/gnome-shell-dbus-interfaces.gresource';
+ _ifaceResource = Gio.Resource.load(path);
+ _ifaceResource._register();
+ }
+
+ let xml = null;
+ let uri = 'resource:///org/gnome/shell/dbus-interfaces/' + iface + '.xml';
+ let f = Gio.File.new_for_uri(uri);
+
+ try {
+ let [ok, bytes] = f.load_contents(null);
+ if (bytes instanceof Uint8Array)
+ xml = imports.byteArray.toString(bytes)
+ else
+ xml = bytes;
+ } catch (e) {
+ log('Failed to load D-Bus interface ' + iface);
+ }
+
+ return xml;
+}